<?php
/**
 * Template Name: Project
 */

get_header() ?>


<?php if ( have_posts() ) while ( have_posts() ) : the_post(); global $post; ?>

<?php if ( ! post_password_required() ) : ?>
<table cellspacing="0px" cellpadding="0px" border="0" class="dobox">
<?php else: ?>
<table cellspacing="0px" cellpadding="0px" border="0" class="whatwedobox">	
<?php endif ?>
	<tr><td valign="top" height="68px" colspan="2">
		<div style="position:absolute;z-index:100;">
			<table cellspacing="0px" cellpadding="0px" border="0" class="menubar">
	       		<tr>
	           		<td width="360px"><a href="<?php echo home_url('/') ?>"><img src="<?php bloginfo('stylesheet_directory')?>/images/logo.png" border="0" height="66px" width="223px"></a></td>
					<?php wv_top_menu() ?>
	       		</tr>
	   		</table><!-- table menu -->
		</div>
		
	<?php if ( ! post_password_required() ) : ?>
		
		<script src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery.scrollTo-1.3.3.js"></script>
		<script src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery.localscroll-1.2.5.js"></script>
		<script src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery.serialScroll-1.2.1.js"></script>
		<script src="<?php bloginfo('stylesheet_directory'); ?>/js/project.js"></script>
			
		<div id="slider">
			<div class="scroll">
	            <div class="scrollContainer">
					<?php 
					if (class_exists('MultiPostThumbnails')) {
						$pageID = get_the_ID();
						
						add_filter("page_{$pageID}_thumbnail_html", 'wv_page_thumbnail_html');
						$numimg = 0;
						for ($i=1; $i < 16; $i++) { 
							if ( MultiPostThumbnails::has_post_thumbnail('page', 'image-'.$i) ) {
								echo '<div class="panel" id="'.$i.'">';
								MultiPostThumbnails::the_post_thumbnail('page', 'image-'.$i, NULL, 'slide-'.$i.'-thumbnail');
								echo '&nbsp;</div>';
								$numimg++;
							}
						}
						
					}
					
					?>
	            </div>
		    </div>

            <div class="slidenum">
				<div class="slidenumcontainer">
					<span class="nav">
					<?php 
					if ($numimg > 1) {
						echo '<a href="#" id="slideprev"> &lt; </a>';
					}
					
					for ($i=1; $i <= $numimg; $i++) { 
						echo '<a class="pagelink" href="#'.$i.'">'.$i.'</a> ';
					} 
					
					if ($numimg > 1) {
						echo '<a href="#" id="slidenext"> &gt; </a>';
					}
					
					?>
					</span>
	            </div>
            </div>

			<span id="info"><a href='#'>info</a></span>
			<span class="closeslide"><a href="<?php echo get_page_link($post->post_parent) ?>" class="closeshow">&times;</a></span>
			<div id="project" class="menubarslide">
				<table cellspacing="0px" cellpadding="0px" border="0">
					<tr><td class="capclose"><a href="#" id="capclose" class="closetimes">&times;</a></td></tr>
					<tr><td class="cap">
					<span class="captitle"><?php the_content() ?>
					</td></tr>
				</table>
			</div>
		</div>
		
	</tr></td>
	<?php else: ?>
	<tr>
		<td align=center class="passwordtd">
			<?php if ( isset($_COOKIE['wp-postpass_' . COOKIEHASH]) ) :?>
				<span style="font-size:12px;color:#ff0000;text-align:right;">Incorrect password.</span>
			<?php endif; ?>
			<?php the_content() ?>
		</td>
	</tr>
	<?php endif ?>
</table>

<?php endwhile; // end of the loop. ?>

<?php //get_sidebar(); ?>
<?php get_footer(); ?>
